
var globalVar = {
	URL_SEARCHPERSONALLBYBM : "/tdg/oa/qywx/api2/v1/operate/searchPersonAllByBM",
	URL_SEARCHBM : "/tdg/oa/qywx/api2/v1/operate/searchBM",
	URL_UPDATESJCLBYDOWN : "/tdg/oa/qywx/api2/v1/operate/updatesjclByDown",
	URL_PDSJCLBYDOWN : "/tdg/oa/qywx/api2/v1/operate/pdsjclByDown",
	URL_CONFIRMDOWN : "/tdg/oa/qywx/api2/v1/operate/confirmDown",
	URL_SHARE : "/tdg/oa/qywx/api2/v1/share",
	URL_SEARCHPERSON : "/tdg/oa/qywx/api2/v1/operate/searchPerson",
	URL_SEARCHPERSONALL : "/tdg/oa/qywx/api2/v1/operate/searchPersonAll",
	URL_UPDATESJCL : "/tdg/oa/qywx/api2/v1/operate/updatesjcl",
	URL_SEARCHGDSETPER : "/tdg/oa/qywx/api2/v1/operate/searchGDSetPer",
	URL_SEARCHGDLIKE : "/tdg/oa/qywx/api2/v1/operate/searchGDLike",
	URL_SEARCHGYD : "/tdg/oa/qywx/api2/v1/operate/searchGYD",
	URL_SEARCHGD : "/tdg/oa/qywx/api2/v1/operate/searchGD",
	URL_SETRPT : "/tdg/oa/qywx/api2/v1/operate/setRPT",
	URL_CONFIRMUP : "/tdg/oa/qywx/api2/v1/operate/confirmUp",
	URL_PDSJCL :  "/tdg/oa/qywx/api2/v1/operate/pdsjcl",
	URL_DOWNBYGD : "/tdg/oa/qywx/api2/v1/operate/downByGD",
	URL_SEARCHGD2 : "/tdg/oa/qywx/api2/v1/operate/searchGD2",
	URL_QHGD : "/tdg/oa/qywx/api2/v1/operate/qhgd",
	URL_FINDMOBYALL : "/tdg/oa/qywx/api2/v1/operate/findMoByAll",
	URL_DOWNBYCHECK : "/tdg/oa/qywx/api2/v1/operate/downByCheck",
	
	//本地测试
	// URL_SEARCHPERSONALLBYBM : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchPersonAllByBM",
	// URL_SEARCHBM : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchBM",
	// URL_SHARE : "http://127.0.0.1:7777/tdg/qywx/api2/v1/share",
    
	// URL_SEARCHGD : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchGD",
	// URL_SEARCHGDLIKE : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchGDLike",
	// URL_SEARCHGYD : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchGYD",
	// URL_SEARCHGDSETPER : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchGDSetPer",
	// URL_FINDMOBYALL : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/findMoByAll",
 //    URL_SEARCHPERSON : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchPerson",
 //    URL_SEARCHPERSONALL : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchPersonAll",
    
 //    URL_CONFIRMUP : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/confirmUp",
 //    URL_CONFIRMDOWN : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/confirmDown",
	// URL_DOWNBYCHECK : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/downByCheck",
	// URL_DOWNBYGD : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/downByGD",
	// URL_QHGD : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/qhgd",
	// URL_UPDATESJCLBYDOWN : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/updatesjclByDown",
	// URL_PDSJCL :  "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/pdsjcl",
	// URL_PDSJCLBYDOWN : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/pdsjclByDown",
	// URL_UPDATESJCL : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/updatesjcl",
    
    //作废了
    // URL_SETRPT : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/setRPT",
    // URL_SEARCHGD2 : "http://127.0.0.1:7777/tdg/qywx/api2/v1/operate/searchGD2",
    
	HTTP_METHOD_GET : "GET",
	HTTP_METHOF_POST : "POST",
	HTTP_CONTENT_TYPE_JSON : "json",
	HTTP_CONTENT_TYPE_TEXT : "text",
    FUNCTION_ID_UP:"QYWX_UP",
    FUNCTION_ID_DOWN:"QYWX_DOWN",
    FUNCTION_ID_DOWN_BYCHECK:"QYWX_DOWN_BYCHECK",
    FUNCTION_ID_DOWN_GD:"QYWX_DOWN_GD",
    FUNCTION_ID_QH:"QYWX_QH",
    FUNCTION_ID_DOWN_PAGE:"QYWX_DOWN_PAGE",
}

//发送ajax post请求
function http_post(url, param, callBack, errorCallBack) {
    ajax(url,"post", "json", param, false, callBack, errorCallBack)
}

//发送ajax get请求
function http_get(url, param, callBack, errorCallBack) {
    ajax(url,"get", "json", param, false ,callBack, errorCallBack)
}

//发送ajax post请求 异步 
function http_post_sync(url, param, callBack, errorCallBack){
    ajax(url,"post", "json", param, true, callBack, errorCallBack)
}

//发送ajax get请求 异步
function http_get_sync(url, param, callBack, errorCallBack){
    // console.trace("http_get_sync 被调用，堆栈信息如下："); // 打印调用堆栈
    ajax(url,"get", "json", param, true ,callBack, errorCallBack)
}

//公共ajax封装
function ajax(url,type, dataType, param, sync, callBack, errorCallBack){
   $.ajax({
        url : url,
        type : type,
        dataType : dataType,
        data : param,
        async : sync,
        success : function(res) {
            if (callBack) callBack(res);
        },
        error : function(err) {
            if( errorCallBack ) errorCallBack(err);
        }
    });    
}


